<script type="text/html" id="module-name">form/signupForm</script>
<div class="container fixed-nav-bar-solution">
    <div class="row">
        <div class="col-lg-6 col-md-6 col-sm-5 ssnd">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <?php
                    if(count ($this->users) > 12) {

                        foreach ($this->users as $user) {
                    ?>
                    <h1>Your community</h1>
                    <label>Recently Added members</label>
                    <?php
                    }
                    }else {
                        ?>
                        <h1>Features</h1>
                    <?php } ?>
                </div>
                <div class="panel-body">
                    <div class="row">

                        <?php

                        if(count ($this->users) > 12) {
                            foreach ($this->users as $user) {
                                ?>

                                <div class="col-lg-6 bottom-margin">
                                    <div class="media">
                                        <a href="#" class="pull-left">

                                            <img itemprop="image" alt=""
                                                 src="/Image/getUserImage?id=<?php echo $user['photoarray']['feed']['id']; ?>"
                                                 class="scaledImageFitWidth img">
                                        </a>

                                        <div class="media-body">

                                            <a href="/people/profile?id=<?php echo $user['id']; ?>">
                                                <h4 class="media-heading"><?php echo $user->name ?></h4>
                                            </a>


                                            From <?php echo array_reduce($user->groups, function ($carry, $item) {
                                                if ($item['type'] === 'block') {
                                                    $carry = $carry . $item['name'];
                                                }
                                                return $carry;
                                            }, ''); ?> <?php echo $user->flatNumber ?>.
                                        </div>
                                    </div>
                                </div>

                            <?php
                            }
                        }else {
                        ?>

                            <ul class="list-group">
                                <li class="list-group-item featureclass fcdiscuss">
                                    <p> Discuss </p>
                                    <img src="/img/discuss.ico" height="60">
                                </li>
                                <li class="list-group-item featureclass fcseek">
                                    Seek Assistance
                                    <img src="/img/assistance.ico" height="60">
                                </li>
                                <li class="list-group-item featureclass fcsm">
                                    Send Message
                                    <img src="/img/message.ico" height="60">
                                </li>
                                <li class="list-group-item featureclass fcpoll">

                                    Poll
                                    <img src="/img/poll.ico" height="60">
                                </li>
                                <li class="list-group-item featureclass fcinfo">
                                    Society Information
                                    <img src="/img/info.ico" height="60">
                                </li>
                                <li class="list-group-item featureclass fcsm"> Search Members
                                    <img src="/img/member.ico" height="60">
                                </li>
                            </ul>

                        <?php } ?>

                    </div>

                </div>

            </div>
        </div>

        <div class="col-lg-6 col-md-6 col-sm-7 col-sm-12">
            <div class="panel panel-info">
                <div class="panel-heading">

                    <div class="row panel-title">
                        <div class="panel-title col-md-7">Sign Up</div>
                        <div>
                            <a id="btn-fblogin" href="#" class="btn btn-primary"
                               style="display: none;">Login with Facebook</a>
                        </div>
                    </div>

                </div>

                <div class="panel-body" style="padding-top: 30px">

                    <div class="alert alert-danger col-sm-12" id="login-alert"
                         style="display: none"></div>


                    <?php if($this->recommender) { ?>
                        <form role="form" class="form-horizontal" id="signupform" action="/guser/signup" method="POST">

                            <div class="input-group" style="margin-bottom: 25px">
                                <span class="input-group-addon"></span> <input type="text"
                                                                               placeholder="Name" value="" name="fullName"
                                                                               class="form-control"
                                                                               id="fullName">
                            </div>
                            <div class="alert alert-danger" role="alert" id="fullNameError"
                                 style="display: none">Please enter your name.
                            </div>


                            <div class="input-group" style="margin-bottom: 25px">
                                <span class="input-group-addon"></span> <input type="text"
                                                                               placeholder="Email"  name="userName"
                                                                               class="form-control" id="userName" readonly
                                      value="<?php echo $this->recommender; ?>"
                                    >
                            </div>
                            <div class="alert alert-danger" role="alert" id="userNameError"
                                 style="display: none">Please enter your email.
                            </div>

                            <div class="input-group" style="margin-bottom: 25px">
                                <span class="input-group-addon"></span> <input type="password"
                                                                               placeholder="Password" name="password"
                                                                               class="form-control"
                                                                               id="password">
                            </div>
                            <div class="alert alert-danger" role="alert" id="passwordError"
                                 style="display: none">Please enter password.
                            </div>

                            <div class="input-group" style="margin-bottom: 25px">
                                <span class="input-group-addon"></span> <input type="password"
                                                                               placeholder="Reconfirm password"
                                                                               name="cpassword"
                                                                               class="form-control" id="cpassword">
                            </div>
                            <div class="alert alert-danger" role="alert" id="cpasswordError"
                                 style="display: none">Passwords do not match.
                            </div>


                            <div class="form-group" style="margin-top: 10px">
                                <!-- Button -->

                                <div class="col-sm-12 controls">
                                    <a class="btn btn-success" href="#" id="btn-login">Submit </a>
                                    <label> Its free!</label>
                                </div>
                            </div>
                        </form>

                    <?php } else {?>

                        Currently, we are allowing signup only after invitation.
                        To join please ask one of your neighbours to invite you.

                    <?php } ?>

                </div>
            </div>
        </div>
    </div>
</div>
<?php
$env = getenv('APP_ENV') ?: 'production';
if($env != 'production') {
    echo '<script data-main="/js/app" src="/js/lib/require.js"></script>';
}
?><!-- /container -->